<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        alert(10+NaN);
        document.writeln(123e10);
        document.writeln(123e-1);
        document.writeln("10" + 10);//数字和字符串相加
        document.writeln("10" + "10")//字符串数字和字符串数字相加
        document.writeln("10" - "10")//字符串数字和字符串数字运算
        document.writeln("10" / "10")
        document.writeln(typeof ("10" * "10"))
        document.writeln(typeof ("10" + "10"))
        document.writeln(10 / "1");
        document.writeln("<hr/>")
        //
        var a = 10 / "name";
        console.log(a);
        console.log(typeof a);
        console.log(isNaN(a));//全局函数isnan
        console.log(100 + NaN);
        console.log("------------------------------------------")
        //
        var b = 2;
        while(b!=Infinity){b=b*b}
        document.writeln(2/0)
        document.writeln(typeof Infinity)
        document.writeln("<hr/>")
        //
        document.writeln(0x100+0x788);
        var c = 100;
        document.writeln(c.toString(8));
        document.writeln(c.toString(2));
        //
        var d = new Number(500);
        console.log(c == d );
        console.log(c === d);
        var e = new Number(500);
        console.log(d == e)//对象无法比较 两个不同地址？
        console.log("=============================")
        //
        var f  = 7.663232323232312321;
        console.log(f.toExponential(1));//四舍五入保留一位并用指数计数法表示
        console.log(f.toExponential(2))
        console.log(f.toExponential(20))
        console.log(f.toFixed(0))//保留0位小数
        console.log(f.toFixed(20))
        console.log(f.toPrecision(2))//保留2位数字
        
        console.log(Number(true)+" "+Number(new Date())+" "+Number("10")+" "+Number("10 20"));
        console.log(parseInt("10 33")+" "+parseInt("20.1")+" "+parseInt("201year")+"" +parseInt("year20"));
        console.log(parseFloat("10.33")+""+parseFloat("20year"));
        console.log("----------------------------------------");
        console.log(Number.MAX_VALUE);
        console.log(Number.MIN_VALUE);
        console.log(Number.POSITIVE_INFINITY);//infinity
        console.log(Number.NEGATIVE_INFINITY);
        console.log(Number.NaN);
        // NaN
        var num ; //undefined
        var num2 = num +10; //undefined +数字 结果为NAN
        console.log(isNaN(num2)) //结果为true

    
   </script>
</head>

<body>

</body>

</html>